package cn.zpro.zookeeper.constant;

import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.retry.ExponentialBackoffRetry;

/**
 * 定义静态变量
 */
public class Constants {
    static final String CONNECTION = "192.168.198.128:2181";
    private static CuratorFramework curatorFramework;

    public static CuratorFramework getInstance() {
        curatorFramework = CuratorFrameworkFactory.
                newClient(CONNECTION, 5000, 5000,
                        new ExponentialBackoffRetry(1000, 3));
        curatorFramework.start();
        return curatorFramework;
    }
}
